﻿using System;
using System.Reflection;

namespace TaiwuModFramework.Common.Attribute {
    /// <summary>
    /// 本特性用于需要自动更新的属性
    /// </summary>
    [Serializable]
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
    public class AttrConfigItem : System.Attribute {

        // Mod配置的属性或字段的修饰符
        [NonSerialized]
        public static readonly BindingFlags Flag = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic;

        public string ConfigItemKey { get; }
        public string ConfigItemDescription { get; }

        public AttrConfigItem(string configItemKey) : this(configItemKey, "") {
        }

        public AttrConfigItem(string configItemKey, string configItemDescription) {
            ConfigItemKey = configItemKey;
            ConfigItemDescription = configItemDescription;
        }
    }
}
